<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="itcast" uri="http://itcast.cn/common/"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!-- jQuery -->
<script src="<%=basePath%>js/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="<%=basePath%>js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="<%=basePath%>js/metisMenu.min.js"></script>
<!-- DataTables JavaScript -->
<script src="<%=basePath%>js/jquery.dataTables.min.js"></script>
<script src="<%=basePath%>js/dataTables.bootstrap.min.js"></script>
<!-- Custom Theme JavaScript -->
<script src="<%=basePath%>js/sb-admin-2.js"></script>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Bootstrap Core CSS -->
<link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="<%=basePath%>css/metisMenu.min.css" rel="stylesheet">
<!-- DataTables CSS -->
<link href="<%=basePath%>css/dataTables.bootstrap.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="<%=basePath%>css/sb-admin-2.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="<%=basePath%>css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="<%=basePath%>css/boot-crm.css" rel="stylesheet" type="text/css">

<head>
<title>登录login页面</title>
</head>
<body>
	<%-- <form id="login_id" action="${pageContext.request.contextPath }/user/login.action" method="post"> --%>
	<form id="login_id" action="<%=basePath%>/user/login" method="post">
		<span style="margin-left: 33px;">商场后台管理页面</span>
		<table>
			<tr>
				<td>用户名:</td>
				<td><input type="text" id="userName" name="userName"></td>
			</tr>
			<tr>
				<td>密码:</td>
				<td><input type="password" id="password" name="password">
				</td>
			</tr>
			<br>
			<tr>
				<td colspan="2">
					<input type="button" style="margin-left: 33px;" onclick="loginVerify()" value="登录">
					<input type="button" value="取消">
				</td>
			</tr>
		</table>

	</form>
</body>
<script>
    function loginVerify() {
        var username = document.getElementById("userName").value;
        var password = document.getElementById("password").value;
        if (!username) {
            alert("用户名为空，请您输入");
            return;
        }
        if (!password) {
            alert("密码为空，请您输入");
            return;
        }
        //调用后端servlet，并将数据传递
        document.getElementById("login_id").submit();
    }
</script>
</html>